import plotly.graph_objects as go
import pandas as pd
data = pd.read_csv('./data/iris.csv')
data.head()

points = go.Scatter(x = data['SepalLength'], y = data['SepalWidth'], mode='markers')
fig = go.Figure(points)
fig.show()

name_to_color = {
    'Iris-setosa': 0,
    'Iris-versicolor': 1,
    'Iris-virginica': 2
}

data['color'] = data['Name'].map(name_to_color)

points = go.Scatter(x = data['SepalLength'], y = data['SepalWidth'],
                    mode='markers', marker={'color': data['color']})
fig = go.Figure(points)
fig.show()

# plotly.express
import plotly.express as px
fig = px.scatter(data, x = 'SepalLength', y = 'SepalWidth',
                color='Name')
fig.show()
fig = px.scatter_matrix(data, dimensions=['SepalLength', 'SepalWidth', 'PetalLength', 'PetalWidth'],
                        color='Name')
fig.show()